#pragma once
#include <vector>

#include "../SSCalculator.h"

struct SSCALCULATOR_API SpreadSeriesResult {
  SpreadSeriesResult() {
    mean = standardDeviation = biasedMean = biasedStandardDeviation = medium =
        percentage = 0;
    max_offset = min_offset = 0;
  }
  double mean;
  double standardDeviation;
  double biasedMean;
  double biasedStandardDeviation;
  double medium;
  double percentage;
  int max_offset;
  int min_offset;
};

struct SSCALCULATOR_API EMARequest {
  EMARequest() {
    series = std::vector<double>();
    // times = std::vector<time_t>();
    N = 1;
  }
  int N;
  std::vector<double> series;
  // std::vector<time_t> times;
};

struct SSCALCULATOR_API EMAResponse {
  EMAResponse(int n) {
    means = std::vector<double>(n);
    stds = std::vector<double>(n);
    // times = std::vector<time_t>();
  }
  std::vector<double> means;
  std::vector<double> stds;
  // std::vector<time_t> times;
};

struct SSCALCULATOR_API SMARequest {
  SMARequest() {
    series = std::vector<double>();
    // times = std::vector<time_t>();
    N = 1;
  }
  int N;
  std::vector<double> series;
  // std::vector<time_t> times;
};

struct SSCALCULATOR_API SMAResponse {
  SMAResponse(int n) {
    means = std::vector<double>(n);
    stds = std::vector<double>(n);
    // times = std::vector<time_t>();
  }
  std::vector<double> means;
  std::vector<double> stds;
  // std::vector<time_t> times;
};

SSCALCULATOR_API void calculateSpreadSeries(const std::vector<double>& spreads,
                                            SpreadSeriesResult& res);
SSCALCULATOR_API void calculateEMA(const EMARequest& request,
                                   EMAResponse& response);
SSCALCULATOR_API void calculateSMA(const SMARequest& request,
                                   SMAResponse& response);